#include<iostream>
#include<string>
#include<ctemplate/template.h>

int main()
{
    std::string in_html = "./ctemplate_usage.html";
    std::string value = "嘿嘿嘿~~";

    //形成数据字典
    ctemplate::TemplateDictionary root("test");
    root.SetValue("key", value);

    //获取被渲染网页对象
    ctemplate::Template *tpl = ctemplate::Template::GetTemplate(in_html, ctemplate::DO_NOT_STRIP);//第二个参数表示原封不动的获取渲染网页对象

    //添加字典数据到网页
    std::string out_html;
    tpl->Expand(&out_html, &root);

    //完成了渲染
    std::cout << out_html << std::endl;
}  

